﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace BloomsburyBanHang.DTO
{
    public class LinhVucDTO
    {

        public int MaLinhVuc;



        public string TenLinhVuc;

        public static LinhVucDTO Convert(THE_LOAI tl)
        {
            LinhVucDTO lv = new LinhVucDTO();
            lv.MaLinhVuc = tl.MaTheLoai;
            lv.TenLinhVuc = tl.TenTheLoai;
            return lv;
        }

        public static List<LinhVucDTO> ConvertList(List<THE_LOAI> kieuSP)
        {
            List<LinhVucDTO> list = new List<LinhVucDTO>();
            for (int i = 0; i < kieuSP.Count; i++)
            {
                list.Add(Convert(kieuSP[i]));
            }
            return list;
        }
        public static THE_LOAI ReserveConvert(LinhVucDTO lv)
        {
            THE_LOAI tl = new THE_LOAI();
            tl.MaTheLoai = lv.MaLinhVuc;
            tl.TenTheLoai = lv.TenLinhVuc;
            return tl;
        }

    }

}